自从 Midjourney 让阿房宫再现辉煌之后, 关键词/语句生成图片的模型进入了我们的视野, 对传统的绘画行业造成了不小的冲击. 而外网的不便利和 Midjourney 的昂贵收费, 让我望而却步. 在一番寻找之后, 找到了与其类似的开源产品 -> stable-diffusion-webui.
(MJ的阿房宫作品)
github地址: https://github.com/AUTOMATIC1111/stable-diffusion-webui
模型源地址: https://civitai.com/(里面有各种模型, 需要科技), 而且一开始默认会有一个初始模型. 自己下载的模型放在stable-diffusion-webui/models/Stable-diffusion文件夹中, 后面初始化界面后可以选择.
模型现地址(转存地址, 现较快) : 无
简介: A browser interface based on Gradio library for Stable Diffusion.
语言: Python3.10
所需配置: 个人6G显存, 差不多能生成600*600的默认配置图片
具体效果: 具体效果非常优秀, 属于开源图像生成产品中最好的一个. 不仅支持下载模型还支持自己训练模型. 在模型网站, 有各种类型的模型和图片可供选择.
配置过程:
# ubuntu环境 python3.10.6 个人感觉这些模型对环境的要求比较苛刻, 尽可能保持一致, 不然可能会出一些意想不到的问题
# 下载库
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
# 修改文件夹所属用户和用户组
sudo chown -R 用户名 stable-diffusion-webui
sudo chgrp -R 用户名 stable-diffusion-webui
cd stable-diffusion-webui
# 进入文件夹
cd stable-diffusion-webui
# 修改一些配置, 不然github过慢
vi /etc/hosts
# 在最后添加这句, 修改github.com的ip地址
140.82.121.3 github.com
# 修改第三方库源
vi launch.py
run_pip(f"install {gfpgan_package}", "gfpgan") 改成 run_pip(f"install -i https://pypi.douban.com/simple/ {gfpgan_package}", "gfpgan")
run_pip(f"install {clip_package}", "clip") 改成 run_pip(f"install -i https://pypi.douban.com/simple/ {clip_package}", "clip")
run_pip(f"install {openclip_package}", "open_clip") 改成 run_pip(f"install -i https://pypi.douban.com/simple/ {openclip_package}", "open_clip")
# 执行, 并等待下载第三方库和初始模型 本地访问
./webui.sh
# 执行, 并等待下载第三方库和初始模型 局域网访问
./webui.sh --listen
# 会出现对应的ip与端口, 默认端口为7860
# 本地访问
http://127.0.0.1:7860
# 局域网访问
http://xx.xx.xx.xx:7860
# 局域网ip查看方式 一般是192.168开头
ifconfig
# 进入界面之后即可, 这里给两组提示词, 分别填入两个框即可
提示词 :
modelshoot style, (wavy blue hair), ((half body portrait)), ((showing boobs, giant boobs, humongous breasts)), (( beautiful light makeup female sorceress in majestic blue dress)), photo realistic game cg, 8k, epic, (blue diamond necklace hyper intricate fine detail), symetrical features, joyful, majestic oil painting by Mikhail Vrubel, Atey Ghailan, by Jeremy Mann, Greg Manchess, WLOP, Charlie Bowater, trending on ArtStation, trending on CGSociety, Intricate, High Detail, Sharp focus, dramatic, photorealistic, black background, epic volumetric lighting, fine details, illustration, (masterpiece, best quality, highres), standing in majestic castle
负面提示词
(((simple background))),monochrome ,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, lowres, bad anatomy, bad hands, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, ugly,pregnant,vore,duplicate,morbid,mut ilated,tran nsexual, hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,bad anatomy,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions, (((missing arms))),((( missing legs))), (((extra arms))),(((extra legs))),pubic hair, plump,bad legs,error legs,username,blurry,bad feet, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry
# 点击generate生成图片
评价: 非常优秀, 占用显存不多, 而且出图也快, 非常值得部署.
最后也是要推广一下五一的论坛网站啦, https://lmzh.top/, 有兴趣的可以去看看, 主要是发一些想法和模型, 有兴趣的领导可以去看看啦, 下期再见.
返回:stable-diffusion-webui 关键词生成图片模型
code/s?__biz=MzI0NjU3NTk3NA==&mid=2247483756&idx=1&sn=7f201a5f015e5934ff02cd77a878503e&chksm=e9bc6765decbee73bf5c15da351381e524b9ddcd2edf58ab9bf9152674db7354895e5238f0f8#rd